function sdirmat=drawP(swmat,du00);
%function sdirmat=drawP(swmat,du00); 
%Generate draws from the Dirichlet distribution
%for an ns x ns matrix of states 
%Markov counts given in swmat (nsxns)
%   generated by countswitch.m 
%du00 priors 
%   Each column(i) corresponds to a Dirichlet( du00(i) )
ns=length(du00); 
if ( ns - length(swmat) ) ~=0
    error('Dimenstion P and Scount do not match'); 
end 
sdirmat=zeros(ns,ns); 
ii=1; 
for ii=1:ns; 
    sdirmat(:,ii)=drawDir( swmat(:,ii) + du00(:,ii) ); 
end

